home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
1,000+ Hot Games
/
1000-Plus-Hot-Games-1999.zip
/
1000+ Hot Games (1999)
/
PROGRAMS
/
CARDWS17
/
INC
/
STACK.CDH
< prev
next >
Wrap
Text File
|
1994-02-06
|
584b
|
32 lines
#ifndef cwsstack
#define cwsstack
stack procedure MoveFirstFrom(c1 : card; src : stack) is
var i : integer;
begin
i:=1;
while i<=src! do
if (src[i] mod 13)=c1 then
begin
Move src[i] to [!+1];
Turn [!] side up;
Draw src;
break;
end
else i:=i+1;
end;
stack procedure MoveAllFrom(c1 : card; src : stack) is
var i,j : integer;
begin
i:=1;
j:=!+1;
while i<=src! do
if (src[i] mod 13)=c1 then
Move src[i] to [!+1]
else i:=i+1;
if j<=! then Turn [j..!] side up;
Draw src;
end;
#endif